//
//  BaseViewController.h
//  wook
//
//  Created by guojiang on 5/8/14.
//  Copyright (c) 2014年 guojiang. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ResultTipView.h"
#import "MBProgressHUD.h"
#import "BaseNavigationViewController.h"
#import "RouterHelper.h"

typedef enum {
    ActivityStateNone,
    ActivityStateSuccess,
    ActivityStateFailure
} ActivityState;

@interface BaseViewController : UIViewController
@property(nonatomic,strong)MBProgressHUD *activity;
@property (nonatomic, strong) RouterHelper *routerHelper;


-(void)addLeftBarButton:(NSString *)title target:(id)target action:(SEL)action;
-(void)addRightBarButton:(NSString *)title target:(id)target action:(SEL)action;

- (void)addLeftBarButtonWithNormalImageName:(NSString *)normalImageName
                          selectedImageName:(NSString *)selectedImageName
                                     target:(id)target
                                     action:(SEL)action;
- (void)addRightBarButtonWithNormalImageName:(NSString *)normalImageName
                           selectedImageName:(NSString *)selectedImageName
                                      target:(id)target
                                      action:(SEL)action;


- (void)pushViewControllerWithClassName:(NSString *)className;


#pragma mark 键盘通知
-(void)enableKeyboardNotification;
-(void)keyboardWillShowKeyHeight:(CGFloat)keyHeight;
-(void)keyboardWillHide;
-(void)setKeyboardShowView:(UIView *)showView keyboardHeight:(CGFloat)keyHeight;



#pragma mark --提示消息
//弹出消息
-(void)promptMessage:(NSString *)text;//当前显示
-(void)promptMessage:(NSString *)text state:(ActivityState)state;
-(void)promptMessage:(NSString *)text view:(UIView *)view;//指定view显示
-(void)promptMessage:(NSString *)text view:(UIView *)view state:(ActivityState)state;
//开始加载提示
- (MBProgressHUD *)startActivityWithTitle:(NSString *)text;//当前显示
- (MBProgressHUD *)startActivityWithTitle:(NSString *)text view:(UIView *)view;//指定view显示
//结束加载提示
- (void)stopActivityWithActivity:(MBProgressHUD *)activity title:(NSString *)text;
- (void)stopActivityWithActivity:(MBProgressHUD *)activity title:(NSString *)text afterDelay:(NSTimeInterval)delay;
- (void)stopActivityWithActivity:(MBProgressHUD *)activity title:(NSString *)text state:(ActivityState)state;



- (void)showNetworkExceptionWithView:(UIView *) toView andTitle:(NSString *)title andButtonTitle:(NSString *)buttonTitle andBtnBlock:(ActionButtonClicked) refreshBtnClick;

@end
